Type.registerNamespace("Telerik.Web.UI.Editor");
Type.registerNamespace("Telerik.Web.UI.Editor.Modules");
Telerik.Web.UI.Editor.ModulesManager=function(a){this._editor=a;
this._modules=[];
this._onEditorModeChangeDelegate=Function.createDelegate(this,this._onEditorModeChange);
};
Telerik.Web.UI.Editor.ModulesManager.prototype={initialize:function(){this.createModules();
this._editor.add_modeChange(this._onEditorModeChangeDelegate);
},getModuleByName:function(a){for(var b=0;
b<this._modules.length;
b++){if(this._modules[b].get_name()==a){return this._modules[b];
}}return null;
},createModules:function(){if(!this._editor){return;
}var a=this._editor.get_modulesJSON();
for(var b=0;
b<a.length;
b++){this.createModule(a[b]);
}},createModule:function(f){if(f.attributes){for(var c in f.attributes){f[c.toLowerCase()]=f.attributes[c];
}}var j=f.enabled;
if(false==j){return;
}f.editor=this._editor;
var b=f.name;
if(b){f.title=this._editor.getLocalizedString(b);
}var i=null;
var a=null;
try{i=eval("Telerik.Web.UI.Editor.Modules."+b);
}catch(d){a=d;
}if(!i){try{i=eval(b);
}catch(d){a=d;
}}if(!i){}if(i){var h=document.createElement("DIV");
var g=this._getModuleZone(f.dockingzone);
delete f.dockingzone;
delete f.dockable;
if(g){if(g.innerHTML=="&nbsp;"||g.innerHTML.length==1){g.innerHTML="";
}g.appendChild(h);
}this._modules[this._modules.length]=$create(i,f,null,null,h);
}},_getModuleZone:function(a){var b=this._editor.get_id();
var c=$get(b+a);
if(!c){c=$get(b+"Module");
}return c;
},_onEditorModeChange:function(a,b){var c=Telerik.Web.UI.EditModes;
var d=a.get_mode();
this.setModulesVisible((d==c.Design));
},setModulesVisible:function(f){var g=this._modules;
var c=false;
if(!f&&this._enabledModules==null){c=true;
this._enabledModules={};
for(var d=0;
d<g.length;
d++){var b=g[d];
if(b.get_visible()){this._enabledModules[b.get_name()]=true;
}b.set_visible(false);
}}else{if(f&&this._enabledModules){c=true;
for(var d=0;
d<g.length;
d++){var e=g[d];
var a=this._enabledModules[e.get_name()];
if(a){e.set_visible(true);
}}this._enabledModules=null;
}}if(c){this._fixIEBottomZoneDisplacement(f);
}},_fixIEBottomZoneDisplacement:function(c){if($telerik.isIE){if(!this._emptySpan){this._emptySpan=document.createElement("span");
var a=this._getModuleZone("Bottom");
if(a){var b=this._emptySpan;
b.innerHTML="&nbsp;";
b.style.display="none";
a.appendChild(b);
}}this._emptySpan.style.display=c?"none":"";
}},get_modules:function(){return this._modules;
}};
Telerik.Web.UI.Editor.ModulesManager.registerClass("Telerik.Web.UI.Editor.ModulesManager",null);
Telerik.Web.UI.Editor.Modules.ModuleBase=function(a){Telerik.Web.UI.Editor.Modules.ModuleBase.initializeBase(this,[a]);
this._editor=null;
this._name="";
this._visible=true;
this._enabled=true;
this._rendered=false;
this._enableMaxWidth=true;
this._title="";
this._className="reModule";
this._scriptFile="";
this._attributes={};
this.isSafari=$telerik.isSafari;
this.isIE=$telerik.isIE;
this.isOpera=$telerik.isOpera;
this.isFirefox=$telerik.isFirefox;
};
Telerik.Web.UI.Editor.Modules.ModuleBase.prototype={initialize:function(){Telerik.Web.UI.Editor.Modules.ModuleBase.callBaseMethod(this,"initialize");
if(this.get_visible()){this.render();
}},render:function(){var a=this.get_element();
if(a){a.className=this._className;
}this._rendered=true;
},toggleVisibility:function(){this.set_visible(!this.get_visible());
},attachEventHandler:function(a,b){var c=this.get_editor();
if(c){c.attachEventHandler(a,b);
}},_getLocalizedString:function(a,b){return this._editor.getLocalizedString(a,b);
},get_editor:function(){return this._editor;
},set_editor:function(a){this._editor=a;
},get_attributes:function(){return this._attributes;
},set_attributes:function(a){this._attributes=a;
},get_scriptFile:function(){return this._scriptFile;
},set_scriptFile:function(a){this._scriptFile=a;
},get_visible:function(){var a=this.get_element();
if(!a){return false;
}return(a.style.display!="none");
},set_visible:function(b){if(b&&!this._rendered){this.render();
}var a=this.get_element();
a.style.display=b?"":"none";
},get_enabled:function(){return this._enabled;
},set_enabled:function(a){this._enabled=a;
},get_title:function(){return this._title;
},set_title:function(a){this._title=a;
},get_name:function(){return this._name;
},set_name:function(a){this._name=a;
}};
Telerik.Web.UI.Editor.Modules.ModuleBase.registerClass("Telerik.Web.UI.Editor.Modules.ModuleBase",Sys.UI.Control);
Telerik.Web.UI.Editor.Modules.RadEditorDomInspector=function(a){Telerik.Web.UI.Editor.Modules.RadEditorDomInspector.initializeBase(this,[a]);
};
Telerik.Web.UI.Editor.Modules.RadEditorDomInspector.prototype={initialize:function(){this._onSelectionChangeDelegate=Function.createDelegate(this,this.showDomPath);
this._editorPathArray=[];
this._removeElementString=this._getLocalizedString("DomInspectorRemoveElement","Remove Element");
Telerik.Web.UI.Editor.Modules.RadEditorDomInspector.callBaseMethod(this,"initialize");
},dispose:function(){this.clear();
this._registerMouseHandlers(false);
Telerik.Web.UI.Editor.Modules.RadEditorDomInspector.callBaseMethod(this,"dispose");
},render:function(){Telerik.Web.UI.Editor.Modules.RadEditorDomInspector.callBaseMethod(this,"render");
this.clear();
this.get_editor().add_selectionChange(this._onSelectionChangeDelegate);
this._registerMouseHandlers(true);
this.showDomPath();
},_registerMouseHandlers:function(a){var b=this.get_element();
if(true==a){var c={click:this._onMouseClick,mouseover:this._onMouseOver,mouseout:this._onMouseOut};
$addHandlers(b,c,this);
}else{if(b){$clearHandlers(b);
}}},_onMouseOver:function(b){var a=this._getReferredEditorElement(b);
if(!a||this._isSelectedElement(a)){return;
}try{Sys.UI.DomElement.addCssClass(a,"RadEDomMouseOver");
}catch(b){}},_onMouseOut:function(b){var a=this._getReferredEditorElement(b);
if(!a){return;
}try{Sys.UI.DomElement.removeCssClass(a,"RadEDomMouseOver");
if(""==a.className){a.removeAttribute("className",0);
a.removeAttribute("class",0);
}}catch(b){}},_onMouseClick:function(c){var b=c.target;
if(!b||b.tagName!="A"){return null;
}if(b.innerHTML==this._removeElementString){var a=this._editorPathArray[0];
this.removeSelectedElement(a);
}else{var d=this._getReferredEditorElement(c);
this.selectElement(d);
}return $telerik.cancelRawEvent(c);
},clear:function(){this.get_element().innerHTML="&nbsp;";
this._editorPathArray=[];
},_createRemoveLink:function(){var a=document.createElement("A");
a.innerHTML=this._removeElementString;
a.href="javascript:void(0)";
a.className="reModule_domlink";
this.get_element().appendChild(a);
},addDomCouple:function(b,e){if(!b||!b.tagName){return;
}var c=this.get_element();
var a=document.createElement("A");
a.oncontextmenu=$telerik.cancelRawEvent;
a.href="javascript:void(0);";
a.innerHTML=b.tagName;
a.className=e?"reModule_domlink_selected ":"reModule_domlink";
c.appendChild(a);
var d=document.createElement("SPAN");
d.innerHTML="&nbsp;> ";
c.appendChild(d);
},_getPathArray:function(b,a){var c=[];
while(b!=a&&null!=b){c[c.length]=b;
b=b.parentNode;
}return c;
},_isSelectedElement:function(a){var b=this._editorPathArray;
if(b&&b[0]==a){return true;
}},_getReferredEditorElement:function(d){var b=d.target;
if(!b||b.tagName!="A"){return null;
}var c=this.get_element().getElementsByTagName("A");
var f=-1;
for(var a=0;
a<c.length;
a++){if(c[a]==b){f=a;
break;
}}if(f>-1){var g=this._editorPathArray.concat([]).reverse();
return g[f];
}},showDomPath:function(){if(!this.get_visible()){return;
}try{var b=this.get_editor().getSelectedElement();
if(!b){return;
}var a=this.get_editor().get_contentArea();
if(this.isIE&&!a.contains(b)){return;
}this.clear();
this._editorPathArray=this._getPathArray(b,a);
var d=this._editorPathArray;
for(var c=d.length-1;
c>=0;
c--){this.addDomCouple(d[c],(c==0));
}if(d.length>0){this._createRemoveLink();
}}catch(e){}},selectElement:function(a){try{this._selectedElement=a;
this.get_editor().selectElement(a);
this._selectedElement=null;
}catch(b){}},removeSelectedElement:function(b){try{if(b.tagName=="TD"||b.tagName=="TH"){this.get_editor().fire("DeleteCell");
}else{if(b.tagName=="TR"){this.get_editor().fire("DeleteRow");
}else{if(b.tagName=="TABLE"||b.tagName=="TBODY"||b.tagName=="THEAD"||b.tagName=="TFOOT"||b.tagName=="EMBED"||b.tagName=="OBJECT"||b.tagName=="INPUT"||b.tagName=="IMG"||b.tagName=="HR"){var c=new Telerik.Web.UI.Editor.GenericCommand(this._removeElementString,this.get_editor().get_contentWindow());
var e=b.parentNode;
e.removeChild(b);
this.get_editor().setFocus();
this.get_editor().executeCommand(c);
a.select();
this.get_editor().setActive();
this.get_editor().setFocus();
}else{if(b.tagName!="BODY"){var a=this.get_editor().createRestorePoint();
var e=b.parentNode;
var c=new Telerik.Web.UI.Editor.GenericCommand(this._removeElementString,this.get_editor().get_contentWindow());
var g="";
for(var d=0;
d<e.childNodes.length;
d++){if(b!=e.childNodes[d]){g+=Telerik.Web.UI.Editor.Utils.getOuterHtml(e.childNodes[d]);
}else{g+=b.innerHTML;
}}Telerik.Web.UI.Editor.Utils.setElementInnerHtml(e,g);
this.get_editor().setFocus();
this.get_editor().executeCommand(c);
a.select();
this.get_editor().setActive();
this.get_editor().setFocus();
}}}}}catch(f){}this.get_editor().raiseEvent("selectionChange");
}};
Telerik.Web.UI.Editor.Modules.RadEditorDomInspector.registerClass("Telerik.Web.UI.Editor.Modules.RadEditorDomInspector",Telerik.Web.UI.Editor.Modules.ModuleBase);
Telerik.Web.UI.Editor.Modules.RadEditorHtmlInspector=function(a){Telerik.Web.UI.Editor.Modules.RadEditorHtmlInspector.initializeBase(this,[a]);
};
Telerik.Web.UI.Editor.Modules.RadEditorHtmlInspector.prototype={initialize:function(){this._onSelectionChangedDelegate=Function.createDelegate(this,this._onSelectionChanged);
this._intervalDelegate=Function.createDelegate(this,this.updateEditorContent);
this._textarea=null;
Telerik.Web.UI.Editor.Modules.RadEditorHtmlInspector.callBaseMethod(this,"initialize");
},dispose:function(){if(this._textarea){this._textarea.value="";
}this._clearInterval();
Telerik.Web.UI.Editor.Modules.RadEditorHtmlInspector.callBaseMethod(this,"dispose");
},_clearInterval:function(){if(this._interval){window.clearInterval(this._interval);
}},set_visible:function(a){Telerik.Web.UI.Editor.Modules.RadEditorHtmlInspector.callBaseMethod(this,"set_visible",[a]);
if(a){this._interval=window.setInterval(this._intervalDelegate,4000);
this._onSelectionChanged();
}else{this._clearInterval();
}},render:function(){Telerik.Web.UI.Editor.Modules.RadEditorHtmlInspector.callBaseMethod(this,"render");
var b=document.createElement("TEXTAREA");
b.style.width="99%";
b.className="reTextarea";
b.setAttribute("rows","10");
b.setAttribute("cols","80");
this._textarea=b;
if(!this.isIE){b.onclick=new Function("this.focus();");
}var a=this.get_element();
a.appendChild(b);
this.get_editor().add_selectionChange(this._onSelectionChangedDelegate);
},updateEditorContent:function(){if(!this.get_visible()){return;
}var b=this._textarea.value;
var a=this.get_editor().get_document().body.innerHTML;
if(b==this._oldContent||b==a){return;
}this._oldContent=b;
this._updateFlag=true;
this.get_editor().set_html(b,this._getLocalizedString("Typing"),false);
this._textarea.focus();
},_onSelectionChanged:function(){if(this._updateFlag){this._updateFlag=false;
return;
}this._textarea.value=this.get_editor().get_document().body.innerHTML;
}};
Telerik.Web.UI.Editor.Modules.RadEditorHtmlInspector.registerClass("Telerik.Web.UI.Editor.Modules.RadEditorHtmlInspector",Telerik.Web.UI.Editor.Modules.ModuleBase);
Telerik.Web.UI.Editor.Modules.RadEditorNodeInspector=function(a){Telerik.Web.UI.Editor.Modules.RadEditorNodeInspector.initializeBase(this,[a]);
this._updateMainPanelDelegate=Function.createDelegate(this,this._updateMainPanel);
this._onToolValueSelectedDelegate=Function.createDelegate(this,this._onToolValueSelected);
this._onDropDownBeforeShowDelegate=Function.createDelegate(this,this._onDropDownBeforeShow);
this._tools={};
this._toolNames={};
this._selectedElement=null;
};
Telerik.Web.UI.Editor.Modules.RadEditorNodeInspector.prototype={_nodeAttributesArray:{TABLE:["width","borderColor","cellSpacing","bgColor","className","SetTableProperties","height","cellPadding","align","border"],TH:["width","borderColor","bgColor","className","SetCellProperties","height","align","noWrap","border"],TD:["width","borderColor","bgColor","className","SetCellProperties","height","align","noWrap","border"],TR:["width","className","height"],A:["href","className","LinkManager","title","target"],IMG:["width","borderColor","className","SetImageProperties","height","align","border","alt"],INPUT:["NAME","width","height","id","title","className","value"],FORM:["className","width","height","NAME","action","id"],TEXTAREA:["className","width","height","NAME","id","rows","cols"]},_nodeInspectorAttributesArray:[["rows","NAME","width","cellSpacing","borderColor","href","alt","align","value","target","SetTableProperties","SetCellProperties","LinkManager"],["cols","id","height","action","cellPadding","border","bgColor","title","noWrap","className","SetImageProperties"]],initialize:function(){Telerik.Web.UI.Editor.Modules.RadEditorNodeInspector.callBaseMethod(this,"initialize");
this.get_editor().add_selectionChange(this._updateMainPanelDelegate);
this._invalidValueString=this._getLocalizedString("NodeInspectorInvalidValue","Invalid value. Please enter a number.");
},render:function(){Telerik.Web.UI.Editor.Modules.RadEditorNodeInspector.callBaseMethod(this,"render");
var a=this.get_element();
a.style.height="50px";
},get_skin:function(){return this._editor.get_skin();
},getNamedCssForSelectedElement:function(a){return this.get_editor().getCssArray(a);
},dispose:function(){this._tools=[];
this._mainPanel=null;
Telerik.Web.UI.Editor.Modules.RadEditorNodeInspector.callBaseMethod(this,"dispose");
},_createMainPanel:function(){var f=this._tools;
var k=this._toolNames;
var g=this._nodeInspectorAttributesArray;
var b=document.createElement("TABLE");
b.border=0;
b.cellSpacing=0;
b.cellPadding=0;
for(var d=0;
d<g.length;
d++){var l=g[d];
var a=b.insertRow(-1);
for(var h=0;
h<l.length;
h++){var c=l[h];
var e=a.insertCell(-1);
e.style.display="none";
e.setAttribute("controlName",c);
e.innerHTML=this._getLocalizedString(c,c);
e.className="reModuleLabel";
e=a.insertCell(-1);
e.style.display="none";
e.setAttribute("controlHolder",c);
var j=this._getControlByName(c);
if(j){f[c]=j;
e.appendChild(j.get_element());
}}}return b;
},_updateMainPanel:function(){if(!this.get_visible()){return;
}if(!this._isMainCreated){this._mainPanel=this._createMainPanel();
this._mainPanel.style.display="none";
this.get_element().appendChild(this._mainPanel);
this._isMainCreated=true;
}var h=this.get_editor();
var a=h.getSelectedElement();
if(!a||a.tagName=="BODY"||a.ownerDocument!=h.get_document()){this._mainPanel.style.display="none";
return;
}if(a.tagName=="TBODY"&&this.isOpera){a=a.parentNode;
}var b=this._nodeAttributesArray[a.tagName];
if(!b){var d=Telerik.Web.UI.Editor.Utils.getElementParentByTag(a,"A");
if(!d){d=Telerik.Web.UI.Editor.Utils.getElementParentByTag(a,"TD");
}if(!d){d=Telerik.Web.UI.Editor.Utils.getElementParentByTag(a,"TH");
}if(d){a=d;
}else{this._mainPanel.style.display="none";
return;
}}var g=null;
if(this._selectedElement){try{g=this._selectedElement.tagName;
}catch(f){}}if(!this._selectedElement||(g!=a.tagName)){var c=this.get_editor().get_document();
this._tools.align.setTagName(a.tagName);
}this._selectedElement=a;
this._updateControlValues(this._selectedElement);
this._mainPanel.style.display="";
},_arrayValueExists:function(a,b){return Array.contains(b,a);
},_issValidAttribValue:function(a){if(null==a){return false;
}a=a.trim();
if(""==a){return true;
}var b=parseInt(a);
if(isNaN(b)){return false;
}return true;
},_onDropDownBeforeShow:function(e,h){var g=this.get_editor();
var d=e.get_name();
var a=e.get_items();
if(a&&a.length>0){return;
}var b=null;
switch(d){case"className":var f=this._selectedElement;
var c=f&&f.tagName?f.tagName:"";
b=g.getCssArray(c);
break;
case"target":b=[["_blank",this._getLocalizedString("blank","New Window")],["_self",this._getLocalizedString("self","Same Window")],["_parent",this._getLocalizedString("parent","Parent window")],["_top",this._getLocalizedString("top","Top browser window")],["_search",this._getLocalizedString("search","Search pane")],["_media",this._getLocalizedString("media","Media pane")]];
break;
case"bgColor":case"borderColor":b=g.get_colors();
break;
}if(b){e.set_items(b);
}},_onToolValueSelected:function(b,a){if(b){if(Telerik.Web.UI.EditorDropDown.isInstanceOfType(b)||Telerik.Web.UI.EditorSpinBox.isInstanceOfType(b)||Telerik.Web.UI.EditorCheckBox.isInstanceOfType(b)||Telerik.Web.UI.EditorTextBox.isInstanceOfType(b)){this.fire(b);
}else{this.get_editor().fire(b.get_name());
}}},executeStyleRuleCommand:function(c,a,d,b){var f=this.get_editor();
var e=new Telerik.Web.UI.Editor.StyleRuleCommand(b,f.get_contentWindow(),c,a,d);
f.executeCommand(e);
},executeAttributeCommand:function(c,a,d,b){var f=this.get_editor();
var e=new Telerik.Web.UI.Editor.AttributeCommand(b,f.get_contentWindow(),c,a,d);
f.executeCommand(e);
},_updateControlValues:function(q){var n=this._nodeAttributesArray[q.tagName];
var e=this._mainPanel;
var v=this._tools;
for(var j=0;
j<e.rows.length;
j++){var o=e.rows[j];
for(var h=0;
h<o.cells.length;
h++){var p=o.cells[h];
var f=p.getAttribute("controlName");
if(f){p.style.display=this._arrayValueExists(f,n)?"":"none";
}var l=p.getAttribute("controlHolder");
if(l){p.style.display=this._arrayValueExists(l,n)?"":"none";
if("none"==p.style.display){continue;
}var g=v[l];
var r=q.getAttribute?q.getAttribute(l,2):"";
if(l=="noWrap"){var b=(q.style.whiteSpace=="nowrap")?"nowrap":"";
if(!b){b=q.noWrap;
}g.set_value(b);
}else{if(l=="border"){var t=parseInt(q.style.borderWidth);
if(isNaN(t)){t="";
}g.set_value(t);
}else{if(l=="borderColor"||l=="bgColor"){if(l=="bgColor"){l="backgroundColor";
}var t=q.style[l];
if(!t){t=q.getAttribute(l);
}if(t){var m=t.indexOf(")");
if(m!=-1){t=t.substring(0,m+1);
}}g.set_color(t);
}else{if(l=="align"){var k=q.tagName.toLowerCase();
switch(k){case"img":g.updateValue("",null);
var c=($telerik.isIE)?"styleFloat":"cssFloat";
var w=(typeof(q.style[c])=="undefined")?"":q.style[c];
var a=(typeof(q.style.verticalAlign)=="undefined")?"":q.style.verticalAlign;
if(a==""&&w!=""){switch(w){case"left":g.updateValue("left",null);
break;
case"right":g.updateValue("right",null);
break;
}}if(w==""){switch(a){case"top":g.updateValue("top",null);
break;
case"middle":g.updateValue("absmiddle",null);
break;
case"text-bottom":g.updateValue("bottom",null);
break;
}}break;
case"td":case"th":var d=q.style.textAlign;
var a=q.style.verticalAlign;
var u=q.getAttribute("align");
var s=q.getAttribute("vAlign");
if((d=="left"||d=="center"||d=="right")&&(a=="top"||a=="middle"||a=="bottom")){g.updateValue(d,a);
}else{if(u||s){g.updateValue(u,s);
}else{g.updateValue(null,null);
}}break;
default:g.updateValue(q.getAttribute("align"),q.getAttribute("vAlign"));
break;
}}else{if(l=="target"){var t=q.getAttribute(l);
g.updateValue(t);
}else{if(l=="width"||l=="height"){var t=q.style[l];
if(!t){t=q.getAttribute(l);
}g.set_value(t);
}else{if("name"==l.toLowerCase()){g.set_value(q.name);
}else{if("className"==l){if(!this.isIE){r=q.getAttribute("class");
}if(!r){r="";
}g.updateValue(r);
}else{if(r&&g.set_value){g.set_value(r);
}else{if(g.set_value){g.set_value("");
}}}}}}}}}}}}}},fire:function(l){if(!l){return;
}var k=l.get_name();
var j=this.get_editor();
var h=this._getLocalizedString(k,k);
if(!h){h=k;
}var a=this._selectedElement;
if("AlignmentSelector"==k){var g=l.getAlign();
var f=l.getVAlign();
var h=this._getLocalizedString("Align","Align");
var b=this._getLocalizedString("vAlign","vAlign");
var i=($telerik.isIE)?"styleFloat":"cssFloat";
var e=a.tagName.toLowerCase();
var m=false;
switch(e){case"img":switch(g){case"left":this.executeStyleRuleCommand(a,i,"left",h);
this.executeStyleRuleCommand(a,"verticalAlign","",h);
break;
case"right":this.executeStyleRuleCommand(a,i,"right",h);
this.executeStyleRuleCommand(a,"verticalAlign","",h);
break;
case"top":this.executeStyleRuleCommand(a,i,"",h);
this.executeStyleRuleCommand(a,"verticalAlign","top",h);
break;
case"bottom":this.executeStyleRuleCommand(a,i,"",h);
this.executeStyleRuleCommand(a,"verticalAlign","text-bottom",h);
break;
case"absmiddle":this.executeStyleRuleCommand(a,i,"",h);
this.executeStyleRuleCommand(a,"verticalAlign","middle",h);
break;
default:this.executeStyleRuleCommand(a,i,"",h);
this.executeStyleRuleCommand(a,"verticalAlign","",h);
break;
}m=true;
break;
case"td":case"th":this.executeStyleRuleCommand(a,"textAlign",g,h);
this.executeStyleRuleCommand(a,"verticalAlign",f,b);
m=true;
break;
default:this.executeAttributeCommand(a,"align",g,h);
this.executeAttributeCommand(a,"vAlign",f,b);
break;
}if(m){a.removeAttribute("align");
a.removeAttribute("vAlign");
}}else{if("borderColor"==k){var n=l.get_selectedItem();
if(this._selectedElement.tagName!="TABLE"){this.executeStyleRuleCommand(this._selectedElement,"borderColor",n,h);
a.removeAttribute("borderColor");
}else{this.executeAttributeCommand(this._selectedElement,"borderColor",n,h);
}}else{if("bgColor"==k){var n=l.get_selectedItem();
this.executeStyleRuleCommand(this._selectedElement,"backgroundColor",n,h);
a.removeAttribute("bgColor");
}else{if("border"==k){var n=l.get_selectedItem();
if(!this._issValidAttribValue(n)){alert(this._invalidValueString);
return;
}if(n){n+="px";
this.executeStyleRuleCommand(this._selectedElement,"borderWidth",n,h);
this.executeStyleRuleCommand(this._selectedElement,"borderStyle","solid",h);
}else{this.executeStyleRuleCommand(this._selectedElement,"borderWidth","",h);
this.executeStyleRuleCommand(this._selectedElement,"borderStyle","",h);
}a.removeAttribute("border");
}else{if("width"==k||"height"==k){var n=l.get_selectedItem();
if(!this._issValidAttribValue(n)){alert(this._invalidValueString);
return;
}function o(q){var r=""+q;
if(r.indexOf("%")!=-1){return r;
}else{var p=r.match(/(em|ex|px|in|cm|mm|pt|pc)$/);
r=parseInt(r);
if(!isNaN(r)){r=(p)?r+p[0]:r+"px";
return r;
}}return q;
}n=o(n);
if(this._selectedElement.removeAttribute){this._selectedElement.removeAttribute(k);
}this.executeStyleRuleCommand(this._selectedElement,k,n,h);
}else{if("noWrap"==k){var d=l.get_selectedItem();
if(d){this.executeStyleRuleCommand(this._selectedElement,"whiteSpace","nowrap",h);
}else{this.executeStyleRuleCommand(this._selectedElement,"whiteSpace","",h);
}}else{var c=k;
var d=l.get_selectedItem();
switch(k){case"background":case"className":case"target":case"value":break;
case"cellSpacing":case"cellPadding":if(!this._issValidAttribValue(d)){alert(this._invalidValueString);
return;
}break;
case"NAME":if(!this.isIE){c="name";
}}this.executeAttributeCommand(a,c,d,h);
}}}}}}if(this._selectedElement){this._updateControlValues(this._selectedElement);
}if(this._selectedElement.style.cssText==""){this._selectedElement.removeAttribute("style");
}},_getControlByName:function(a){var b=null;
var d={text:this._getLocalizedString(a),name:a,addClickHandler:true,skin:this.get_skin()};
var c={valueSelected:this._onToolValueSelectedDelegate,show:this._onDropDownBeforeShowDelegate};
switch(a){case"className":d.text=this._getLocalizedString("className");
d.width="90px";
b=Telerik.Web.UI.EditorButton.createTool(d,c,Telerik.Web.UI.Editor.ApplyClassDropDown);
break;
case"borderColor":case"bgColor":d.addCustomColorText=this._getLocalizedString("AddCustomColor");
b=Telerik.Web.UI.EditorButton.createTool(d,c,Telerik.Web.UI.Editor.ColorPicker);
break;
case"align":d.name="AlignmentSelector";
d.text=this._getLocalizedString("align");
b=Telerik.Web.UI.EditorButton.createTool(d,c,Telerik.Web.UI.Editor.AlignmentSelector);
break;
case"SetCellProperties":case"SetTableProperties":case"SetImageProperties":case"LinkManager":delete c.show;
b=Telerik.Web.UI.EditorButton.createTool(d,c);
break;
case"target":d.sizetofit=true;
d.width="90px";
b=Telerik.Web.UI.EditorButton.createTool(d,c,Telerik.Web.UI.EditorUpdateableDropDown);
break;
case"noWrap":delete c.show;
b=Telerik.Web.UI.EditorButton.createTool(d,c,Telerik.Web.UI.EditorCheckBox,document.createElement("span"));
break;
case"width":case"height":case"cellPadding":case"cellSpacing":case"rows":case"cols":case"border":delete c.show;
b=Telerik.Web.UI.EditorButton.createTool(d,c,Telerik.Web.UI.EditorSpinBox,document.createElement("span"));
break;
default:delete c.show;
b=Telerik.Web.UI.EditorButton.createTool(d,c,Telerik.Web.UI.EditorTextBox,document.createElement("span"));
}return b;
}};
Telerik.Web.UI.Editor.Modules.RadEditorNodeInspector.registerClass("Telerik.Web.UI.Editor.Modules.RadEditorNodeInspector",Telerik.Web.UI.Editor.Modules.ModuleBase);
Telerik.Web.UI.Editor.Modules.RadEditorStatistics=function(a){Telerik.Web.UI.Editor.Modules.RadEditorStatistics.initializeBase(this,[a]);
};
Telerik.Web.UI.Editor.Modules.RadEditorStatistics.prototype={initialize:function(){this._enableMaxWidth=false;
this._wordsString=this._getLocalizedString("StatisticsWords","Words:");
this._charactersString=this._getLocalizedString("StatisticsCharacters","Characters:");
this._onDoCountDelegate=Function.createDelegate(this,this.doCount);
Telerik.Web.UI.Editor.Modules.RadEditorStatistics.callBaseMethod(this,"initialize");
},render:function(){Telerik.Web.UI.Editor.Modules.RadEditorStatistics.callBaseMethod(this,"render");
this.get_editor().add_selectionChange(this._onDoCountDelegate);
this.doCount();
},doCount:function(){if(!this.get_visible()){return;
}var h=this.get_editor().get_text();
var a=0;
var b=0;
if(h){var d=/[!\.?;,:&_\-\?\{\}\[\]\(\)~#'"]/g;
h=h.replace(d,"");
var g=/(^\s+)|(\s+$)/g;
h=h.replace(g,"");
if(h){var c=/\s+/;
var f=h.split(c);
a=f.length;
var i=/(\r\n)+/g;
h=h.replace(i,"");
b=h.length;
}}var e=this.get_element();
e.innerHTML="<span style='line-height:22px'>"+this._wordsString+" "+a+" &nbsp;&nbsp;"+this._charactersString+" "+b+"&nbsp;</span>";
}};
Telerik.Web.UI.Editor.Modules.RadEditorStatistics.registerClass("Telerik.Web.UI.Editor.Modules.RadEditorStatistics",Telerik.Web.UI.Editor.Modules.ModuleBase);
